<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vuforia | Cying</title><meta name="keywords" content="Unity"><meta name="author" content="Cying-承影"><meta name="copyright" content="Cying-承影"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="A Game Engine   1.下载所需软件  UnityHub，是 Unity 的下载器，安装完成后可以选择近几个版本进行安装， Vuforia，是一个增强现实的平台，提供了很多 API 接口，只需用户简单进行调用即可实现增强现实的效果 点击名称跳转至下载，其中 Vuforia 除了在网站上下载，在 UnityHub 安装 Unity 时，也有些版本会带有 Vuforia 的插件，那就只要">
<meta property="og:type" content="article">
<meta property="og:title" content="Vuforia">
<meta property="og:url" content="http://cyingk.github.io/2020/02/07/Vuforia/index.html">
<meta property="og:site_name" content="Cying">
<meta property="og:description" content="A Game Engine   1.下载所需软件  UnityHub，是 Unity 的下载器，安装完成后可以选择近几个版本进行安装， Vuforia，是一个增强现实的平台，提供了很多 API 接口，只需用户简单进行调用即可实现增强现实的效果 点击名称跳转至下载，其中 Vuforia 除了在网站上下载，在 UnityHub 安装 Unity 时，也有些版本会带有 Vuforia 的插件，那就只要">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=775631544,4140499919&fm=26&gp=0.jpg">
<meta property="article:published_time" content="2020-02-06T17:19:52.000Z">
<meta property="article:modified_time" content="2020-02-15T18:16:19.000Z">
<meta property="article:author" content="Cying-承影">
<meta property="article:tag" content="Unity">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=775631544,4140499919&fm=26&gp=0.jpg"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://cyingk.github.io/2020/02/07/Vuforia/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//www.clarity.ms"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>(function(c,l,a,r,i,t,y){
    c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
    t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
    y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "4zndahq92q");</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: 'days',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"Traditional Chinese Activated Manually","cht_to_chs":"Simplified Chinese Activated Manually","day_to_night":"Dark Mode Activated Manually","night_to_day":"Light Mode Activated Manually","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
};

const saveToLocal = {
  // ttl 單位是 天
  set: function setWithExpiry(key, value, ttl) {
    if (ttl === 0) return
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}

// https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
const getScript = url => new Promise((resolve, reject) => {
  const script = document.createElement('script')
  script.src = url
  script.async = true
  script.onerror = reject
  script.onload = script.onreadystatechange = function() {
    const loadState = this.readyState
    if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
    script.onload = script.onreadystatechange = null
    resolve()
  }
  document.head.appendChild(script)
})</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2020-02-16 02:16:19'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = '1'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}const fontSizeVal = saveToLocal.get('global-font-size')
if (fontSizeVal !== undefined) {
  document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
}})()</script><meta name="generator" content="Hexo 5.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">Loading...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/img/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">23</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">12</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">3</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> Categories</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://5b0988e595225.cdn.sohucs.com/images/20190831/84729f5c5bb346208416445feb485df6.jpeg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Cying</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> Categories</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Vuforia</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2020-02-06T17:19:52.000Z" title="Created 2020-02-07 01:19:52">2020-02-07</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2020-02-15T18:16:19.000Z" title="Updated 2020-02-16 02:16:19">2020-02-16</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Blog/">Blog</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">Word count:</span><span class="word-count">678</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">Reading time:</span><span>2min</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><html><head></head><body><p><a target="_blank" rel="noopener" href="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=775631544,4140499919&fm=26&gp=0.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=775631544,4140499919&fm=26&gp=0.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></p>
<center><h1>A Game Engine</h1></center>

<hr>
<h1 id="1-下载所需软件"><a href="#1-下载所需软件" class="headerlink" title="1.下载所需软件"></a>1.下载所需软件</h1><blockquote>
<ul>
<li><a href="https://unity3d.com/get-unity/download" target="_blank" rel="noopener"><code>UnityHub</code></a>，是 <code>Unity</code> 的下载器，安装完成后可以选择近几个版本进行安装，</li>
<li><a href="https://developer.vuforia.com/downloads/sdk#downloadModal" target="_blank" rel="noopener"><code>Vuforia</code></a>，是一个增强现实的平台，提供了很多 <code>API</code> 接口，只需用户简单进行调用即可实现增强现实的效果<ul>
<li>点击名称跳转至下载，其中 <code>Vuforia</code> 除了在网站上下载，在 <code>UnityHub</code> 安装 <code>Unity</code> 时，也有些版本会带有 <code>Vuforia</code> 的插件，那就只要把复选框勾上即可，不用再在网站上下载<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214204142359.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption class="fancybox"><img alt title data-src="https://img-blog.csdnimg.cn/20191214204142359.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
</ul>
</li>
</ul>
</blockquote>
<hr>
<h1 id="2-创建-Unity-项目"><a href="#2-创建-Unity-项目" class="headerlink" title="2.创建 Unity 项目"></a>2.创建 <code>Unity</code> 项目</h1><p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214204334207.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214204334207.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214204536969.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption class="fancybox"><img alt title data-src="https://img-blog.csdnimg.cn/20191214204536969.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h1 id="3-配置-MainCamera"><a href="#3-配置-MainCamera" class="headerlink" title="3.配置 MainCamera"></a>3.配置 <code>MainCamera</code></h1><blockquote>
<ul>
<li>删除主相机 <code>MainCamera</code>，在 <code>GameObject</code>菜单 - <code>Vuforia Engine</code> 中点击创建 <code>AR Camera</code>，点击之后会要导入一些资源，确定就好</li>
<li><strong>获取许可证。</strong><ul>
<li>点击打开 <a href="https://developer.vuforia.com/vui/develop/licenses" target="_blank" rel="noopener"><code>Vuforia</code></a> 官网，注册一个账号</li>
<li>点击 <code>Develop</code> - <code>Get Development Key</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214205421329.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214205421329.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>如下创建<br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214205518608.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214205518608.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></li>
<li>点击 <code>Name</code> 获取许可证<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214205721394.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214205721394.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214205754803.png" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214205754803.png" class="lazyload"></a></li>
</ul>
</li>
<li><strong>配置 <code>AR Camera</code></strong><ul>
<li>打开系统相机<br><ul>
<li><code>File</code> - <code>Build Setting...</code> <br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214210143302.png#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214210143302.png#pic_center" class="lazyload"></a></li>
<li><code>Payer Settings...</code> - <code>Player</code> - <code>XR Settings</code> 勾选 <code>Virtual Reality Supported</code> 和 <code>Vuforia Augmented Reality Supported</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214210359866.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214210359866.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></li>
</ul>
</li>
<li>配置 <code>AR Camera</code> 许可证<ul>
<li>选中 <code>AR Camera</code> ，在它的信息中选择打开 <code>Open Vuforia Engine Configuration</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214210922904.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214210922904.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>将 <code>Vuforia</code> 官网申请的许可证粘贴至此<br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214211021728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214211021728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</blockquote>
<hr>
<h1 id="4-配置要识别的目标-Image"><a href="#4-配置要识别的目标-Image" class="headerlink" title="4.配置要识别的目标 - Image"></a>4.配置要识别的目标 - <code>Image</code></h1><blockquote>
<ul>
<li><p>配置 <code>Image</code>， 在 <code>GameObject</code>菜单 - <code>Vuforia Engine</code> 中点击创建 <code>Image</code><br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214214733229.png#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214214733229.png#pic_center" class="lazyload"></a></p>
</li>
<li><p>这个 <code>Image</code> 是作为识别的目标，就是说，用户 <code>Image</code> 上设置有一张图片，当相机识别到和这个图片相似的图片时，就可以创建出显示增强的物体</p>
</li>
<li><p>先来说怎么自定义图片，我们不能直接给他设置图片，要先上传到 <code>Vuforia</code> 官网，然后再把一张或多张图片以 <code>Unity包</code> 的形式下载下来，然后导入后才可使用</p>
<ul>
<li>来到 <a href="https://developer.vuforia.com/vui/develop/databases" target="_blank" rel="noopener">Vuforia</a> 官网， <code>Support</code> - <code>Add DataBase</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214211724593.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214211724593.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>然后如下设置<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214211954801.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214211954801.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>点击 <code>name</code> 进入<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214212041443.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214212041443.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>选择 <code>Add Target</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214212109550.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214212109550.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>上传，<code>Type</code> 默认 <code>Single Image</code>，<code>Width</code>，<code>Name</code> 随意<br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214212226846.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214212226846.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></li>
<li>上传完后，稍等片刻即可，其中<code>Rating</code> 就是可识别度，<code>Vuforia</code> 服务器是会将图片进行灰度处理，然后对其进行评分，用户最好是选用轮廓分明、色差较大的图片作为目标<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214212416996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214212416996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
<li>下载，选择 <code>Unity Editor</code>，然后 <code>DownLoad</code><br><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214212705984.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214212705984.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a><br></li>
</ul>
</li>
<li><p>导入下载的数据包</p>
<ul>
<li>将包直接拖拽至 <code>Project</code> 面板的 <code>Assets</code> 文件夹，<code>Import</code><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214213031826.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214213031826.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214213151901.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214213151901.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70#pic_center" class="lazyload"></a></li>
<li>导入成功<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214213257891.png#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214213257891.png#pic_center" class="lazyload"></a></li>
</ul>
</li>
<li><p>设置 <code>Image</code><br>选中 <code>ImageTarget</code> ，在右侧 <code>Inspector</code> 面板中的 <code>DataBase</code> 选择为下载的数据包，然后将其下面的 <code>Image Target</code> 设置为需要的图片。<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214213510620.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214213510620.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<ul>
<li>成功<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214213732981.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214213732981.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
</ul>
</li>
</ul>
</blockquote>
<hr>
<h1 id="5-创建显示增强对象"><a href="#5-创建显示增强对象" class="headerlink" title="5.创建显示增强对象"></a>5.创建显示增强对象</h1><blockquote>
<p>简单来说就是设置在识别出图片之后要显示出什么东西</p>
<ul>
<li>设置方法就是将要显示的物体拖拽放置在 <code>ImageTarget</code> ，使它成为 <code>ImageTarget</code> 的子对象</li>
<li>这里我用几个简单模型稍做演示<br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214214315320.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214214315320.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></li>
</ul>
</blockquote>
<h1 id="6-运行"><a href="#6-运行" class="headerlink" title="6.运行"></a>6.运行</h1><p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214214449873.png#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214214449873.png#pic_center" class="lazyload"></a><br><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191214214941826.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191214214941826.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0N5aW5nSw==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
</body></html></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="mailto:undefined">Cying-承影</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="http://cyingk.github.io/2020/02/07/Vuforia/">http://cyingk.github.io/2020/02/07/Vuforia/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Unity/">Unity</a></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2020/02/14/Assembly/"><img class="prev-cover" src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2751080876,2103309092&amp;fm=26&amp;gp=0.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">Previous Post</div><div class="prev_info">Assembly</div></div></a></div><div class="next-post pull-right"><a href="/2020/02/01/Struts2/"><img class="next-cover" src="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2597327423,2034793762&amp;fm=26&amp;gp=0.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">Next Post</div><div class="next_info">Struts2</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>Catalog</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-number">1.</span> <span class="toc-text">A Game Engine</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#1-%E4%B8%8B%E8%BD%BD%E6%89%80%E9%9C%80%E8%BD%AF%E4%BB%B6"><span class="toc-number">2.</span> <span class="toc-text">1.下载所需软件</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-%E5%88%9B%E5%BB%BA-Unity-%E9%A1%B9%E7%9B%AE"><span class="toc-number">3.</span> <span class="toc-text">2.创建 Unity 项目</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-%E9%85%8D%E7%BD%AE-MainCamera"><span class="toc-number">4.</span> <span class="toc-text">3.配置 MainCamera</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-%E9%85%8D%E7%BD%AE%E8%A6%81%E8%AF%86%E5%88%AB%E7%9A%84%E7%9B%AE%E6%A0%87-Image"><span class="toc-number">5.</span> <span class="toc-text">4.配置要识别的目标 - Image</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#5-%E5%88%9B%E5%BB%BA%E6%98%BE%E7%A4%BA%E5%A2%9E%E5%BC%BA%E5%AF%B9%E8%B1%A1"><span class="toc-number">6.</span> <span class="toc-text">5.创建显示增强对象</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#6-%E8%BF%90%E8%A1%8C"><span class="toc-number">7.</span> <span class="toc-text">6.运行</span></a></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="footer_custom_text">却道天凉好个秋</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="Increase font size"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="Decrease font size"><i class="fas fa-minus"></i></button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>if (document.getElementsByClassName('mermaid').length) {
  if (window.mermaidJsLoad) mermaid.init()
  else {
    getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(() => {
      window.mermaidJsLoad = true
      mermaid.initialize({
        theme: 'default',
      })
      false && mermaid.init()
    })
  }
}</script></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>